package parser

import (
	"golearnpro/pc/engs"
	"regexp"
)

func GetCity(html string) engs.ParseResult {
	reg := regexp.MustCompile(`<a href="(http://www.zhenai.com/zhenghun/[0-9a-zA-Z]+)"[^>]*>([^<]+)</a>`)

	list := reg.FindAllStringSubmatch(html, -1)

	result := engs.ParseResult{}

	for _, m := range list {
		result.Items = append(result.Items, m[2])
		result.Requests = append(result.Requests, engs.Request{
			m[1],
			UserList,
		})
	}

	return result
}
